package com.caocaog.market.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.caocaog.market.entity.ShopChannel;
import com.caocaog.market.entity.dto.ShopChannelTreeDTO;
import org.jeecg.common.exception.JeecgBootException;

import java.util.List;
import java.util.Set;

/**
 * @Description: 频道信息表
 * @Author: jeecg-boot
 * @Date:   2021-11-19
 * @Version: V1.0
 */
public interface IShopChannelService extends IService<ShopChannel> {

	/**根节点父ID的值*/
	public static final String ROOT_PID_VALUE = "0";

	/**树节点有子节点状态值*/
	public static final String HASCHILD = "1";

	/**树节点无子节点状态值*/
	public static final String NOCHILD = "0";

	/**新增节点*/
	void addShopChannel(ShopChannel shopChannel);

	/**修改节点*/
	void updateShopChannel(ShopChannel shopChannel) throws JeecgBootException;

	/**删除节点*/
	void deleteShopChannel(String id) throws JeecgBootException;

	/**查询所有数据，无分页*/
    List<ShopChannel> queryTreeListNoPage(QueryWrapper<ShopChannel> queryWrapper);
    //获取该pid的所有二级频道
    List<ShopChannel> queryTreeListByPid(String pid);

	/**
	 * 顶置
	 * @param id 频道id
	 * @return 受影响行数
	 */
	int setTop(String id);

	/**
	 * 取消顶置
	 * @param id 频道id
	 * @return 受影响行数
	 */
	int setBottom(String id);

	/**
	 * 查出当前分站首页展示的频道，前几条是固定的，其余的会把分站新增的频道默认展示在前面
	 *
	 * @param shopChannel 查询参数
	 * @return 七条首页展示的频道列表
	 */
	List<ShopChannel> shopChannelHomeDisplayList(ShopChannel shopChannel);

	List<ShopChannel> getSecondaryLevelChannel(String channelId, String siteId);

	/**
	 * 获取二级频道List
	 * @return 查询结果
	 */
	Set<ShopChannelTreeDTO> childChoseList();
}
